const adminModel = require("../model/adminModel.js")
async function checkHeader(ctx, next) {
	// console.log(ctx.request.header.authorization)
	let res =await adminModel.checkToken(ctx.request.header.authorization)
	console.log(res, 5)
	if (res.length > 0) {
		await next()
	} else {
		ctx.body = {
			code: 500,
			codeInfo: "token过期"
		}
	}

}

module.exports = {
	checkHeader
}